package max.nlp.similarity;

import java.util.TreeMap;

import edu.sussex.nlp.jws.JWS;
import edu.sussex.nlp.jws.JiangAndConrath;

public class WordNet {
//	public static void main(String[] args) {
//		String dir = "/home/max/resources/WordNet";
//		JWS ws = new JWS(dir, "3.0");
//		JiangAndConrath jcn = ws.getJiangAndConrath();
//		ws.get
//		System.out.println("Jiang & Conrath\n");
//		TreeMap<String, Double> 	scores1	=	jcn.jcn("apple", "banana", "n");			// all senses
//		for(String s : scores1.keySet())
//			System.out.println(s + "\t" + scores1.get(s));
//	}
	public static void main(String[] args) {
		String q = "Texas";
		String rev = new StringBuffer(q).reverse().toString();
		// Perfect matches win
		String both = "(basic_name_str:("+q+"*) AND basic_name_rev:("+rev+"*))";
		// Then left-anchored matches
		String left = "(basic_name_str:("+q+"*))";
		// Then anything else
		String name = "(basic_name:("+q+"*) OR basic_name:("+q+"))";
		// Now some hardcoded boosting as we put it together
		String boost = "boost:boost^10";
		System.out.println( "("+both+"^10 OR "+left+"^4 OR "+name+")^0.2"+" AND "+boost);
	}
}
